package test.test1.mybatis.pojo;

public class Answer {
	private Integer id;
	private String value;
	private String best;
	private Integer player_id;
	private Integer question_id;
	
	private Player player;
	private Question question;
	
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getBest() {
		return best;
	}

	public void setBest(String best) {
		this.best = best;
	}

	public Integer getPlayer_id() {
		return player_id;
	}

	public void setPlayer_id(Integer player_id) {
		this.player_id = player_id;
	}

	public Integer getQuestion_id() {
		return question_id;
	}

	public void setQuestion_id(Integer question_id) {
		this.question_id = question_id;
	}

	

	public Answer() {
		// TODO Auto-generated constructor stub
	}
	
	public Answer(Player player, Question q) {
		this.player = player;
		this.player_id = player.getId();
		this.question = q;
		this.question_id = q.getId();
		this.id = (int)(Math.random() * 10000);
		
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Player getPlayer() {
		return player;
	}

	public void setPlayer(Player player) {
		this.player = player;
	}

	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}

	public String toString() {
		return "[AN:" + this.id + "," + this.value + "," + this.best + "," + this.player_id
				+ "," + this.question_id + "]";
	}
}
